
package com.jy.entity;

public class PageBean {
	int total;//总行
	int pages;//页
	int curpage;//当前页
	int size=7;//每页几条
	int begin,end;//开始结束页码
	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		//求页数
		this.total = total;
		pages=total/size;
		if(total %size!=0){
			pages++;
		}
	}
	public int getPages() {
		return pages;
	}
	public void setPages(int pages) {
		this.pages = pages;
	}
	public int getCurpage() {
		return curpage;
	}
	public void setCurpage(int curpage) {
		this.curpage = curpage;
		//当前=8 begin? end?
		if(pages<=10){
			begin=1;
			end=pages;
		}else{
			begin=curpage-5;
			end=curpage+4;
			if(begin<1){
				begin=1;
				end=10;
			}
			if(end>pages){
				end=pages;
				begin=pages-9;
			}
		}
	}
	public int getSize() {
		return size;
	}
	public void setSize(int size) {
		this.size = size;
	}
	public int getBegin() {
		return begin;
	}
	public void setBegin(int begin) {
		this.begin = begin;
	}
	public int getEnd() {
		return end;
	}
	public void setEnd(int end) {
		this.end = end;
	}

}